Skip to content

Conversation

@whankinsiv
Copy link
Collaborator

@whankinsiv whankinsiv commented Oct 20, 2025

This PR adds a validation tool to compare the Acropolis-generated SPDD with the epoch stakes reported by DB Sync.
It provides a trusted reference for verifying our active-stake snapshot and helps identify discrepancies between the Acropolis state and the real on-chain data. Done as part of #234.

Bugs found during validation:

  • MIRs not counted towards active stake in epoch 208.
    Fix: Pay MIRs to reward account at the start of the epoch instead of delaying until reward calculation.
  • Retired pools not removed from SPDD
    Fix: Filter based on active pool set.
  • Retired pools not receiving their deposit back at the correct boundary
    Note: I was unable to find the fix but this may be an early Shelley era bug. In epoch 209 we have 3 pools missing 500 ADA of active stake due to deregistration and subsequent reregistration of their pools.

Example output

(The 42 pool mismatch is due to MIRs not being included.)
Screenshot 2025-10-20 at 2 31 11 PM

Other changes:

  • Refactored the spdd_retation_epochs config option in omnibus.toml to always require an integer, removing the separate store-spdd-history flag (Set to 0 by default which is equivalent to store-spdd-history=false).
  • Re-added the /spdd?epoch={n} REST handler in spdd_state, which is used by the validator.
  • Fixed elided lifetime warnings for StakeAddressMap methods.

Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
Signed-off-by: William Hankins <william@sundae.fi>
…accurate SPDD size logging

Signed-off-by: William Hankins <william@sundae.fi>
@sandtreader
Copy link
Collaborator

Very happy with this :-) Interested to know if there was a reason you wrote the test in TS - ease of CI?

@sandtreader sandtreader merged commit 7c41bd4 into main Oct 22, 2025
2 checks passed
@sandtreader sandtreader deleted the whankinsiv/spdd-validation-test branch October 22, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants